# Contributor: Patrycja Rosa <alpine@ptrcnull.me>
# Maintainer: Patrycja Rosa <alpine@ptrcnull.me>
pkgname=py3-pbs-installer
pkgver=2024.10.16
pkgrel=0
pkgdesc="Installer for Python Build Standalone"
url="https://github.com/frostming/pbs-installer"
arch="noarch"
license="MIT"
makedepends="py3-gpep517 py3-pdm-backend"
checkdepends="py3-pytest"
subpackages="$pkgname-pyc"
source="https://github.com/frostming/pbs-installer/archive/$pkgver/py3-pbs-installer-$pkgver.tar.gz"
builddir="$srcdir/pbs-installer-$pkgver"
options="!check" # tests/ directory empty

build() {
	export PDM_BUILD_SCM_VERSION="$pkgver"
	gpep517 build-wheel \
		--wheel-dir .dist \
		--output-fd 3 3>&1 >&2
}

check() {
	python3 -m venv --clear --without-pip --system-site-packages .testenv
	.testenv/bin/python3 -m installer .dist/*.whl
	.testenv/bin/python3 -m pytest
}

package() {
	python3 -m installer -d "$pkgdir" \
		.dist/*.whl
}

sha512sums="
1b6bfc64bf311d03cf318365b1d16968ac599b40b247970477d6555791407bc104813bd60f82e30d88a13cd37873fef269a98640ee301f86028e6ddf7d097958  py3-pbs-installer-2024.10.16.tar.gz
"
